package com.itjisu.hongbao.core;

import android.app.Application;

import com.itjisu.hongbao.constants.ConfigEntry;
import com.itjisu.hongbao.constants.GlobalConfig;
import com.itjisu.hongbao.util.CrashHandler;
import com.itjisu.hongbao.util.Util;


public class MyApplication extends Application {

    private static MyApplication application;

    public static final String APP_ID = "wxe9f16206a37ab08d";
//    public static HuosdkManager sdkManager = null;


    @Override
    public void onCreate() {
        super.onCreate();

        application = this;

        String appChannel = Util.getMeteDataByKey(this, "DIS_CHANNEL");
        GlobalConfig.pkg = getPackageName();
        GlobalConfig.setChannel(appChannel);

        GlobalConfig.android_id = android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);

        ConfigEntry.init(getApplicationContext());
        CrashHandler handler = CrashHandler.getInstance();
        handler.init(getApplicationContext());
        Thread.setDefaultUncaughtExceptionHandler(handler);
    }

    public final static MyApplication getCurrentApplication() {
        return application;
    }

}
